Inspector: Protect against childless windows
authorTimm Bäder <mail@baedert.org>
Wed, 26 Aug 2015 09:54:01 +0000 (11:54 +0200)
committerTimm Bäder <mail@baedert.org>
Wed, 26 Aug 2015 10:04:44 +0000 (12:04 +0200)
gtk/inspector/inspect-button.c

index b2cdfb537feb63249561df82f848f2f18319182b..c0df8deae58d61258dca692c2c89a36cb4e86e0e 100644 (file)
@@ -405,10 +405,14 @@ draw_flash (GtkWidget          *widget,
 
   if (GTK_IS_WINDOW (widget))
     {
+      GtkWidget *child = gtk_bin_get_child (GTK_BIN (widget));
       /* We don't want to draw the drag highlight around the
        * CSD window decorations
        */
-      gtk_widget_get_allocation (gtk_bin_get_child (GTK_BIN (widget)), &alloc);
+      if (child == NULL)
+        return FALSE;
+
+      gtk_widget_get_allocation (child, &alloc);
     }
   else
     {